
# this module look for sprng (http://sprng.cs.fsu.edu) support
# it will define the following values
#
# SPRNG_INCLUDE_PATH = where sprng.h can be found
# SPRNG_LIBRARY      = the library to link against (hdf5 etc)
#

#set the list where to look for the library
SET(SPRNG_LIBRARY_PATHS
  /usr/lib
  /opt/lib
  /usr/local/lib
  /sw/lib
  lib
)

#set the list where to look for the library
SET(SPRNG_INCLUDE_PATHS
  /usr/include
  /opt/include
  /usr/local/include
  /sw/include
  include
)

IF($ENV{SPRNG_DIR} MATCHES "sprng")
  MESSAGE(STATUS "Using environment variable SPRNG_DIR.")
  SET(SPRNG_LIBRARY_PATHS ${SPRNG_LIBRARY_PATHS} $ENV{SPRNG_DIR}/lib)
  SET(SPRNG_INCLUDE_PATHS ${SPRNG_INCLUDE_PATHS} $ENV{SPRNG_DIR}/include)
ENDIF($ENV{SPRNG_DIR} MATCHES "sprng")


FIND_LIBRARY(SPRNG_LIBRARY sprng ${SPRNG_LIBRARY_PATHS})
FIND_PATH(SPRNG_INCLUDE_PATH sprng.h ${SPRNG_INCLUDE_PATHS})

IF(SPRNG_LIBRARY)
  INCLUDE_DIRECTORIES(${SPRNG_INCLUDE_PATH})
  SET(SPRNG_LIBRARY ${SPRNG_LIBRARY})
  SET(HAVE_LIBSPRNG 1)
  MESSAGE(STATUS "Found SPRNG")
ENDIF(SPRNG_LIBRARY) 
